package com.jarics.gwt.client.composites;

import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.MouseListener;
import com.google.gwt.user.client.ui.Widget;

/**
 * This class is for widgets that handles MouseListener, inject to GridWidget upon creation.
 * @author erickaudet
 *
 */
public class JaricsMouseListener implements MouseListener {
	
	FlexTable grid;
	
	public JaricsMouseListener(FlexTable grid){
		this.grid = grid;
	}
	
	public void onMouseDown(Widget sender, int x, int y) {	
	}

	public void onMouseEnter(Widget sender) {
		GridWidget wCell = (GridWidget) sender;
		grid.getRowFormatter().addStyleName( wCell.getRow(), "over");
	}

	public void onMouseLeave(Widget sender) {		
		GridWidget wCell = (GridWidget) sender;
		grid.getRowFormatter().removeStyleName( wCell.getRow(), "over");
	}

	public void onMouseMove(Widget sender, int x, int y) {
	}

	public void onMouseUp(Widget sender, int x, int y) {
	}

}
